<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<div class="block">
    
    <div class="block_head">
        <div class="bheadl"></div>
        <div class="bheadr"></div>
        
        <logic:lessThan name="stampForm" property="id" value="1">
            <h2>Add SD Charge</h2>
        </logic:lessThan>
        <logic:greaterThan name="stampForm" property="id" value="0">
            <h2>Edit SD Charge at "<fmt:formatDate type="both" timeStyle="short" value="${stampForm.startDate}"/>"</h2>
        </logic:greaterThan>
        
    </div>
    <!-- .block_head ends -->
    
    <div class="block_content clearfix">
        <html:form styleClass="validate-form" styleId="stampForm" action="admin/stamp.do" method="post">
            
            <logic:notEmpty name="errorMessages" >
                <div class="message errormsg">
                    <logic:iterate id="message" name="errorMessages">
                        <p><bean:write name="message"/></p>
                    </logic:iterate>
                </div>
            </logic:notEmpty>
            <logic:notEmpty name="successMessages" >
                <div class="message success">
                    <logic:iterate id="message" name="successMessages">
                        <p><bean:write name="message"/></p>
                    </logic:iterate>
                </div>
            </logic:notEmpty>
            
            <html:hidden property="id" />
            <logic:greaterThan name="stampForm" property="id" value="0">
                <p><label>Start Date: </label><span class="note"><fmt:formatDate type="both" timeStyle="short" value="${stampForm.startDate}"/></span></p>
            </logic:greaterThan>
            
            <p>
                <label for="sdCharge">SD Charge:</label><span class="required">*</span><br/>
                <html:text styleId="sdCharge" styleClass="text small required number" property="sdCharge"/>
                <label for="sdCharge" class="note">U.S. dollars</label>
                <label for="sdCharge" class="error" generated="true" style="display:none;"></label>
            </p>
            
            <hr/>
            
            <p>
                <html:submit property="action" value="Save" styleClass="submit small"/>
                <logic:greaterThan name="stampForm" property="id" value="0">
                    <html:link styleClass="confirm-button submit small red" action="/admin/stampListing.do?action=delete" paramId="id" paramName="stampForm" paramProperty="id">
                        Delete
                    </html:link>
                </logic:greaterThan>                
                <html:link action="/admin/stampListing.do" styleClass="submit small gray">Cancel</html:link>
            </p>
            
            
        </div>
        <!-- .block_content ends -->
    </html:form>
        
    <div class="bendl"></div>
    <div class="bendr"></div>
    
</div>
<!-- .block ends -->
